home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 12 / BBS in a box XII-1.iso / Files / Bus / S / S7P 3.6 Manual.sit / S7P 3.6 Manual.rsrc / TEXT_136.txt < prev    next >
Encoding:
Text File  |  1993-11-14  |  13.5 KB  |  260 lines

  1. CreateAEVT
  2.  
  3. Err:=CreateAEVT(Class;ID;Addr;theEvent)
  4.  
  5. Creates an AppleEvent of the specified class and ID with the specified target address. This doesn't add any parameters to the event and doesn't actually send it.
  6.  
  7. Example:
  8. _________________________________________________________________
  9. $err:=CreateAEVT("misc";"dosc";theTarget;$myEvent)
  10. if ($err=0)
  11.  $err:=PutTextParam($myEvent;"----";"message(‚ÄúHi there!‚Äù)")
  12.  if ($err=0)
  13.   $err:=SendAppleEvent($myEvent;$myReply; kAENoReply+CanInteract ;-1)
  14.   $err:=DisposeDesc($myReply)
  15.  end if
  16.  $err:=DisposeDesc($myEvent)
  17. end if
  18. _________________________________________________________________
  19.  
  20. DisposeDesc
  21.  
  22. Err:=DisposeDesc(desc)
  23.  
  24. Disposes an AppleEvent or Target Address descriptor. This should always be called for an AppleEvent created with CreateAEVT and the reply created when the event is sent as well as a target address that is no longer needed.
  25.  
  26. GetAliasParam
  27.  
  28. GetAliasParam(theEvent;theKey;aFileName)
  29.  
  30. Extracts a file alias parameter from an AppleEvent. To reference the last event received in a procedure installed via HandleAEVT, pass 0 for the event handle. The alias will be converted to a string representing the full pathname of the file.
  31.  
  32. GetList
  33.  
  34. Err:=GetList(anEvent;theKey;anArray)
  35.  
  36. Extracts a descriptor list from an AppleEvent into a 4D array. To reference the last event received in a procedure installed via HandleAEVT, pass 0 for the event handle. All items in the list must be of the same type. The array will be created automatically of the correct type to hold the contents of the list. A list of lists or AERecords will be returned as an array of long integers, with each element containing a handle to a descriptor. The type of an existing array won‚Äôt be changed, and if you‚Äôre using an existing array, a list of strings requires a TEXT array. In a compiled database, the array must be previously defined and you must know the data type in advance.
  37.  
  38. GetLongParam
  39.  
  40. Err:=GetLongParam(anEvent;keyWord;actualType;Value)
  41.  
  42. Extracts a long integer parameter from an AppleEvent. To reference the last event received in a procedure installed via HandleAEVT, pass 0 for the event handle.
  43.  
  44. GetPicParam
  45.  
  46. Err:=GetPicParam(anEvent;theKey;convert;aPicture)
  47.  
  48. Extracts a picture parameter from an AppleEvent. To reference the last event received in a procedure installed via HandleAEVT, pass 0 for the event handle. If the picture came from another 4D application, ‚Äòconvert‚Äô should be 0, otherwise it should be non-zero and will cause the picture to be converted from standard Macintosh format to 4D‚Äôs internal picture format.
  49.  
  50. GetRealParam
  51.  
  52. Err:=GetRealParam(anEvent;theKey;Value)
  53.  
  54. Extracts a floating point number parameter from an AppleEvent. To reference the last event received in a procedure installed via HandleAEVT, pass 0 for the event handle. The value can be any numeric type and will be coerced into 4D‚Äôs 10-byte extended format.
  55.  
  56. GetShortParam
  57.  
  58. Err:=GetShortParam(anEvent;keyWord;actualType;Value)
  59.  
  60. Extracts a short integer parameter from an AppleEvent. To reference the last event received in a procedure installed via HandleAEVT, pass 0 for the event handle.
  61.  
  62. GetTextParam
  63.  
  64. Err:=GetTextParam(anEvent;theKey;Value)
  65.  
  66. Extracts a text parameter from an AppleEvent. To reference the last event received in a procedure installed via HandleAEVT, pass 0 for the event handle.
  67.  
  68. Obj
  69.  
  70. ospec:=Obj(class;container;value)
  71.  
  72. Creates an object specifier identified by a numeric value. Class should be the 4-letter class ID. Container can be either another object specifier or 0 to specify a null container. The container will automatically be disposed of to simplify creating nested containers. Value should be numeric. For example, to create the specifier 'Word 1 of Paragraph 2 of Document "Foo"' you would use: 
  73. Obj("cwor";Obj("cpar";ObjNamed("docu";0;"Foo");2);1)
  74.  
  75. ObjNamed
  76.  
  77. ospec:=ObjNamed(Class;Container;Name)
  78.  
  79. Creates an object specifier identified by a name. Class should be the 4-letter class ID. Container can be either another object specifier or 0 to specify a null container. The container will automatically be disposed of to simplify creating nested containers. Name should be a string. For example, to create the specifier 'Word 1 of Paragraph 2 of Document "Foo"' you would use: Obj("cwor"; Obj("cpar"; ObjNamed("docu";0;"Foo");2);1)
  80.  
  81. Property
  82.  
  83. ospec:=Property(Name;Container)
  84.  
  85. Creates an object specifier for a property. Container should be the object specifier the property applies to. The container will automatically be disposed of to simplify creating nested containers. Name should be the 4-letter property ID. For example, to create the specifer ''font of word 1" you would use:  Property("font";Obj("cwor";0;1))
  86.  
  87. PutAliasParam
  88.  
  89. Err:=PutAliasParam(anEvent;theKey;fileName)
  90.  
  91. Adds a file alias to an AppleEvent. The parameter is identified by a keyword. The value should be a string representing a file name which will be converted to an alias record. In 4D version 3.0.3 or later, you can specify -1 for the AppleEvent to add an item to the reply event in a procedure called from HandleAEVT.
  92.  
  93. New in V3.5: To specify an alias of a file on a remote volume, you can use a string such as ‚Äú[Server@MyZone]HD80:A File‚Äù. The zone name can be eliminated if its in the same zone. You can also use a string like ‚Äú[]HD80:some file‚Äù to create a minimal alias containing only the full path name. This is useful when sending an AppleEvent to a remote machine.
  94.  
  95. Example:
  96. _________________________________________________________________
  97. $err:=CreateAEVT("misc";"dosc";theTarget;$myEvent)
  98. if ($err=0)
  99.  $err:=PutAliasParam($myEvent;"----";"HD80:Scripts:Do this")
  100.  if ($err=0)
  101.   $err:=SendAppleEvent($myEvent;$myReply; kAENoReply ;-1)
  102.   $err:=DisposeDesc($myReply)
  103.  end if
  104.  $err:=DisposeDesc($myEvent)
  105. end if
  106. _________________________________________________________________
  107.  
  108. PutList
  109.  
  110. Err:=PutList(anEvent;key;SpecialType;anArray)
  111.  
  112. Adds a descriptor list built from a 4D array to an AppleEvent. SpecialType can specify a data type other than the default implied by the type of the list. The only conversions are  from text representing file names to a list of aliases and from long integer to AERecord or object specifiers. In all other cases the data format will remain unchanged.  In 4D version 3.0.3 or later, you can specify -1 for the AppleEvent to add an item to the reply event in a procedure called from HandleAEVT.
  113.  
  114. To specify text to alias conversion, SpecialType should be "alis".
  115.  
  116. To send a list of AERecords or object specifiers, SpecialType should be ‚Äúreco‚Äù and the long integer array should contain descriptors created with Obj, ObjNamed, or CreateAERec. In this case, each element of the array will automatically be disposed when you call PutList.
  117.  
  118. New in Version 3.5: You can now use a 2-dimensional array with PutList.
  119.  
  120. Example:
  121. _________________________________________________________________
  122. Selection To Array([file1]field1;anArray)
  123. $err:=CreateAEVT("send";"data";theTarget;$myEvent)
  124. if ($err=0)
  125.  $err:=PutList($myEvent;"----";"";anArray)
  126.  if ($err=0)
  127.   $err:=SendAppleEvent($myEvent;$myReply;kAEWaitReply;-1)
  128.   $err:=DisposeDesc($myReply)
  129.  end if
  130.  $err:=DisposeDesc($myEvent)
  131. end if
  132. _________________________________________________________________
  133.  
  134. PutLongParam
  135.  
  136. Err:=PutLongParam(anEvent;key;actualType;value)
  137.  
  138. Adds a long  integer parameter to an AppleEvent. The parameter is identified by a keyword and can be given a special type. (It defaults to typeLongInteger if 'actualType' is an empty string.) In 4D version 3.0.3 or later, you can specify -1 for the AppleEvent to add an item to the reply event in a procedure called from HandleAEVT.
  139.  
  140. PutObject
  141.  
  142. Err:=PutObject(anEvent;key;anObject)
  143.  
  144. Puts an object specifier in an AppleEvent. This command will dispose the object specifier after adding it to the AppleEvent. This command should be used in conjunction with Obj and/or ObjNamed to create the specifier. In 4D version 3.0.3 or later, you can specify -1 for the AppleEvent to add an item to the reply event in a procedure called from HandleAEVT.
  145.  
  146. Example:
  147. _________________________________________________________________
  148. $err:=MakeAddress("DFB0";$addr)
  149. if ($err=0)
  150.  $err:=CreateAEVT("core";"getd";$addr;$myEvent)
  151.  if ($err=0)
  152.   $err:=PutObj($myEvent;"----";objNamed("cMPV";0;"theDate"))
  153.   if ($err=0)
  154.    $err:=SendAppleEvent($myEvent;$myReply;kAEWaitReply;-1)
  155.    $err:=GetTextParam($myReply;"----";theResult)
  156.    $err:=DisposeDesc($myReply)
  157.   end if
  158.   $err:=DisposeDesc($myEvent)
  159.  end if
  160.  $err:=DisposeDesc($addr)
  161. end if
  162. _________________________________________________________________
  163.  
  164. PutPicParam
  165.  
  166. Err:=PutPicParam(anEvent;theKey;convert;aPicture)
  167.  
  168. Adds a picture parameter to an AppleEvent. It will be identified by a keyword and will always be of type 'PICT'. If ‚Äòconvert‚Äô is non-zero, the picture will be converted from 4D‚Äôs internal format to a standard Macintosh¬Æ picture. In 4D¬Æ version 3.0.3 or later, you can specify -1 for the AppleEvent to add an item to the reply event in a procedure called from HandleAEVT.
  169.  
  170. PutRealParam
  171.  
  172. Err:=PutRealParam(anEvent;theKey;Value)
  173.  
  174. Adds a floating point number to an AppleEvent. The number will be in 4D‚Äôs internal 10-byte floating point format and the descriptor type will be ‚Äòexte‚Äô. Most applications will be able to convert it to their desired floating point type. In 4D version 3.0.3 or later, you can specify -1 for the AppleEvent to add an item to the reply event in a procedure called from HandleAEVT.
  175.  
  176. PutShortParam
  177.  
  178. Err:=PutShortParam(anEvent;key;actualType;value)
  179.  
  180. Adds a short integer parameter to an AppleEvent. The parameter is identified by a keyword and can be given a special type. (It defaults to typeShortInteger if 'actualType' is an empty string.) In 4D version 3.0.3 or later, you can specify -1 for the AppleEvent to add an item to the reply event in a procedure called from HandleAEVT.
  181.  
  182. PutTextParam
  183.  
  184. Err:=PutTextParam(anEvent;key;value)
  185.  
  186. Adds a text parameter to an AppleEvent. The parameter is identified by a keyword and will always be of type 'typeText'. In 4D version 3.0.3 or later, you can specify -1 for the AppleEvent to add an item to the reply event in a procedure called from HandleAEVT.
  187.  
  188. SendAppleEvent
  189.  
  190. Err:=SendAppleEvent(theEvent;theReply;send mode;time out)
  191.  
  192. Sends an AppleEvent previously created by CreateAEVT. SendMode can be any of the constants kAEWaitReply, kAENoReply, AlwaysInteract, CanInteract, and/or NeverInteract. TimeOut specifies the time (in 1/60ths of a second) to wait for a reply. Specify -1 for default time-out or -2 for no time- out.
  193.  
  194. CreateAERec
  195.  
  196. Err:=CreateAERec(theRecord)
  197.  
  198. Creates an AE Record, which is a list of keyword-specified parameters within an AppleEvent. All commands which add and extract parameters from an AppleEvent can be applied the same way to an AE Record. The AE Record must be disposed when you finish using it. Adding it to an AppleEvent or another AE Record with PutAERecord will automatically dispose it.
  199.  
  200. Example:
  201. _________________________________________________________________
  202. ` this is how to send a request to Claris¬Æ Resolve‚Ñ¢
  203. ` create the request range table
  204. $Err:=CreateAERec($tabl)
  205. $Err:=PutLongParam($tabl;"TLPT";"";100)
  206. $Err:=PutLongParam($tabl;"BRPT";"";200)
  207. $Err:=PutKeyword($tabl;"RTRN";"TEXT")
  208. ` create the record which holds the table
  209. $Err:=CreateAERec($reqList)
  210. $Err:=PutAERecord($reqlist;"TABL";$tabl)
  211. ` create the actual AppleEvent and add the record
  212. $Err:=CreateAppleEvent("CLRS";"GVAL";$Resolve;$GetValue)
  213. $Err:=PutAERecord($GetValue;"----";$reqList)
  214. $Err:=SendAppleEvent($GetValue;$Reply;kAEWaitReply;-1)
  215. ` extract the data from the reply record
  216. $Err:=GetAERecord($Reply;"----";$reqList)
  217. $Err:=GetAERecord($reqList;"TABL";$tabl)
  218. $Err:=GetTextParam($tabl;"VAL ";$resultString)
  219. ` clean up everything we allocated
  220. $Err:=DisposeDesc($tabl)
  221. $Err:=DisposeDesc($reqList)
  222. $Err:=DisposeDesc($Reply)
  223. $Err:=DisposeDesc($GetValue)
  224. _________________________________________________________________
  225.  
  226. GetAERecord
  227.  
  228. Err:=GetAERecord(anEvent;Key;theRecord)
  229.  
  230. Extracts an AE Record from an AppleEvent or from another AE Record. Any commands which apply to AppleEvents for adding and/or extracting data can also be used on AE Records. To reference the last event received in a procedure installed via HandleAEVT, pass 0 for the event handle.
  231.  
  232. PutAERecord
  233.  
  234. Err:=PutAERecord(anEvent;Key;theRecord)
  235.  
  236. Adds an AE Record to an AppleEvent or to another AE Record. The AE Record will automatically be disposed after this call. Note that function this is really the same as PutObject, since an object specifier is simply a special kind of AE Record. In 4D version 3.0.3 or later, you can specify -1 for the AppleEvent to add an item to the reply event in a procedure called from HandleAEVT.
  237.  
  238. PutKeyword
  239.  
  240. Err:=PutKeyword(anEvent;key;value)
  241.  
  242. Adds a 4-character keyword (enumerated type) to an AppleEvent or AE Record. If you need to pass a type rather than an enumeration, use PutLongParam(aevt; key; ‚Äùtype‚Äù; Long(value)) instead. In 4D version 3.0.3 or later, you can specify -1 for the AppleEvent to add an item to the reply event in a procedure called from HandleAEVT.
  243.  
  244. GetKeyword
  245.  
  246. Err:=GetKeyword(anEvent;key;value)
  247.  
  248. Extracts a 4-character enumerated type keyword from an AppleEvent or AE Record.  To reference the last event received in a procedure installed via HandleAEVT, pass 0 for the event handle.
  249.  
  250. GetBoolean
  251.  
  252. Err:=GetBoolean(anEvent;key;value)
  253.  
  254. Extracts a boolean value from an AppleEvent or AE Record. To reference the last event received in a procedure installed via HandleAEVT, pass 0 for the event handle.
  255.  
  256. PutBoolean
  257.  
  258. Err:=PutBoolean(anEvent;key;value)
  259.  
  260. Adds a boolean value to an AppleEvent or AE Record. In 4D version 3.0.3 or later, you can specify -1 for the AppleEvent to add an item to the reply event in a procedure called from HandleAEVT.